#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    int hammingDistance(int x, int y) {
        int a = x ^ y;
        int count = 0;
        while (true)
        {
            if ((a & 1) == 1)
                count++;
            a >>= 1;
            if (a == 0)
                break;
        }
        return count;
    }
};